package per.hnvcam.thread;

public class Task implements Runnable {
	private Runnable task;
	private Runnable postProcessing;
	
	public Task(Runnable task) {
		this.task = task;
	}

	public void run() {
		if (task != null) {
			task.run();
		}
		if (postProcessing != null) {
			postProcessing.run();
		}
	}
	
	protected void setPostProcessing(Runnable postProcessing) {
		this.postProcessing = postProcessing;
	}
}
